<%-- 
    Document   : login_logout
    Created on : Mar 12, 2013, 3:16:47 AM
    Author     : duonghung1369
--%>

<%@tag description="put the tag description here" pageEncoding="UTF-8"%>

<%-- The list of normal or fragment attributes can be specified here: --%>
<%@taglib uri="/struts-tags" prefix="s" %>

<%-- any content can be specified here e.g.: --%>
<div id="login-logout" style="float: right; color: white; font-size: 20px; font-weight: bold">
    <s:if test="#session.logined == true">
        <s:if test="#session.isadmin == false">
            <a href="../cart/view_cart.html">
                <img src="../resource/images/cart.png" alt="cart" /></a>
            <span id="numberCartItems" style="color: burlywood; margin-right: 10px; font-weight: bold">
                0
            </span>
        </s:if>
    </s:if>
    <s:else>
        <a href="../cart/view_cart.html">
            <img src="../resource/images/cart.png" alt="cart" /></a>
        <span id="numberCartItems" style="color: burlywood; margin-right: 10px; font-weight: bold">
            0
        </span>
    </s:else>

    <s:if test="#session.logined != 'true'">
        <a href="../login/index.html" style="color: whitesmoke">Login</a> |
        <a href="../register/index.html" style="color: whitesmoke">Sign up </a>       
    </s:if>
    <s:else>
        <a href="../user/viewProfile.html" style="color: darkorange"><s:property value="#session.username" /></a> |
        <a href="../login/logout.html" style="color: darkorange">Sign out </a>        
        <s:if test="#session.isadmin == false">
            |<a href="../order/history.html" style="color: darkorange; font-size: 20px" >Ordered</a>
        </s:if>
        <s:else>
            |<a href="../admin/index.html" style="color: darkorange; font-size: 20px" >AdminCP</a>
        </s:else>
    </s:else>

</div>